#ifndef _SPI_H
#define _SPI_H

#include <stdbool.h>
#include "stm32f4xx.h"


void SPI2_to_PMW_Init(void);
bool SPI2_PMW_Exchange(uint32_t length, const uint8_t *data_tx, uint8_t *data_rx);

void SPI3_to_MPU6500_Init(void);
uint8_t SPI3_ReadWrite_Byte(uint8_t byte);
u8 SPI3_ReadReg(u8 reg);
void SPI3_WriteReg(u8 reg ,u8 data);
void SPI3_ReadRegs(u8 reg, u8 length, u8 *data);

#endif
